package main

import (
	"io"
	"log"
	"os"
)

func LogInit() {
	f, err := os.OpenFile("main.log", os.O_CREATE|os.O_APPEND|os.O_RDWR, os.ModePerm)
	if err != nil {
		log.Println("can not create log file")
		return
	}
	m := io.MultiWriter(os.Stdout, f)
	log.SetOutput(m)
	log.SetFlags(log.Ldate | log.Ltime)
}
